The present invention relates generally to removing and adding devices to a computer system, and, more specifically, to xe2x80x9chot swapping,xe2x80x9d which refers to the ability to remove or add the device while the power supply of either the device or the system is in the on state.
Because hot swapping can generate voltage spikes and data corruption that may damage both the device and the system, avoiding hot swapping is preferable. However, as a user does not have to be concerned about the state of the power supply or I/O bus while adding or removing a device, hot swapping is convenient. Further, the system, having the power supply in the on state, may maintain its tasks while the device is hot swapped.
Hot swapping has been available for devices complying with the Small Computer System Interface (SCSI) standard. However, in many approaches, the device is hot swapped directly from a SCSI bus, which affects all devices attached to the bus. Signal disruption on the bus because of hot swapping may last for many milliseconds. The SCSI specification allows different levels of hot swapping, all of which require that the bus be inactive during hot swapping. If a system supports hot swapping while the bus is active, then the system would have to keep track of all command and data transfers on the bus in order to maintain the system integrity. Unfortunately, there are potentially hundreds or thousands of these transfers during each hot swap.
With the advent of network attached storage (NAS), hot swapping storage devices is more demanding. Further, because some segments of NAS are geared towards small office environment, using SCSI in hot swapping is relatively expensive in such environment.
Based on the foregoing, it is clearly desirable that techniques be provided to solve the above deficiencies.
Techniques are disclosed for hot-swapping devices from and to a computer system while maintaining the system integrity. One embodiment of the techniques uses an interface bridge between the system and a device complying with the IDE standard. The bridge uses the IDE protocol to communicate with the device and uses the SCSI protocol to communicate with the system. Consequently, with respect to the system, the bridge is treated as a SCSI device.
While the device has been attached to the bridge, the bridge is in an xe2x80x9cattachedxe2x80x9d state, which allows communications between the device and the system. In one embodiment, the bridge converts SCSI commands received from the system to IDE commands to be understood by the device. Further, if the bridge recognizes that the device has been removed from the system, then the bridge transitions to a xe2x80x9ccleanupxe2x80x9d state, then a xe2x80x9cremovedxe2x80x9d state.
While in the cleanup state, the bridge takes appropriate actions and provides signals to a SCSI bus to indicate that the device has been removed from the system. In these conditions, the system is well informed that the device is not available, and the system can thus respond accordingly.
The removed state indicates that the device has been removed from the system. While in this removed state, the bridge transitions to a reboot state if the bridge recognizes that the device has been added to the system. From the reboot state, the bridge transitions to the attached state after initializing necessary signals for the device and the system.
In accordance with the techniques disclosed herein, hot swapping a device occurs on one side of the bridge, and the system on the other side of the bridge is well informed of such hot swapping in order to respond accordingly. Consequently, the bus on the system side is shielded from hot swapping disruption, thereby maintaining the system integrity.